<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>首页</title>
    <script src="./jquery-3.4.1.min.js"></script>
</head>
<body>
    <button>点击获取二维码</button><a href='http://www.baidu.com'>登录</a>
    <img src=""/>
    <script>
        $(function () {
            $("button").click(function () {
                var url = 'getQrCode';
                $.get(url,function (resp) {
                    console.log(resp.data)
                    var src ='https://mp.weixin.qq.com/cgi-bin/showqrcode?ticket='+resp.data
                    $("img").attr("src",src)
                })
            })
        })
    </script>
</body>
</html>